private _checkLayoutAdded() { if (!this._layoutAdded) { document.body.appendChild(this._layout.container);
this._layoutAdded = true;
private _startLoadingStorage() { if (!this._storageElem) { this.reportError('No data embedded in this file.'); this._storageElem = this.dom.createElement('div', { display: 'none' }, this.dom.documenOverride.body); var uniqueKey = this._getUniqueKey();
this._storageLoader = new StorageLoader(this.dom, this._storageElem, uniqueKey);
this._storageLoader.loadStorage({ detectionComplete: (domTime, persistence) => this._storageDetectionComplete(domTime, persistence),
loadProgress: (totalFileCount, lastLoadedFileName) => this._storageLoadProgress(totalFileCount, lastLoadedFileName),
loadComplete: () => this._storageLoaded()
private _storageDetectionComplete(domTime: Date, persistence: { name: string; time: Date; }) { private _storageLoadProgress(totalFileCount: number, lastLoadedFileName: string) { private _storageLoaded() { private _getUniqueKey() { var key = window.location.pathname;
var ignoreSuffix = '/index.html';
if (key.length > ignoreSuffix.length && key.slice(key.length - ignoreSuffix.length) === ignoreSuffix)
key = key.slice(0, key.length - ignoreSuffix.length);